using System.Threading.Tasks;
using Microsoft.Extensions.Logging;

namespace ExamServer.Service
{
  public class MyDependency : IMyDependency
  {
    private readonly ILogger<MyDependency> _logger;

    public MyDependency(ILogger<MyDependency> _logger)
    {
      this._logger = _logger;

    }
    public string MethodA()
    {
      return "这是MethodA方法";
    }

    public string MethodB(int num)
    {
      return "这是MethodB方法，接收参数:" + num;
    }

    public Task<string> WriteMessage(string message)
    {
        _logger.LogInformation("MyDependency接收:"+message);
       string result  ="我是MyDependency类中的WriteMessage方法,接收:"+message;
        return Task.FromResult(result);
    }


  }
}